﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
using FreeGoo.WpfRenderer.Constants;

namespace FreeGoo.WpfRenderer.MouseCursor.WpfMouseCursorItems
{
    public class WpfMouseCursorItemCircle : WpfMouseCursorItem
    {
        public WpfMouseCursorItemCircle(WpfMouseCursor wpfMouseCursor, int pathStep)
            : base(wpfMouseCursor, pathStep)
        {
        }

        protected override void BuildGraphics()
        {
            Ellipse outline = new Ellipse();
            double size = GetSize();
            outline.Width = size;
            outline.Height = size;
            outline.RenderTransform = new TranslateTransform{X=-size / 2.0, Y=-size / 2.0};
            outline.SetValue(Canvas.ZIndexProperty, 0);
            outline.Fill = BrushConstants.White;
            Elements.Add(outline);
            WpfMouseCursor.RenderTarget.Children.Add(outline);
            
            Ellipse fill = new Ellipse();
            size = size - 4;
            fill.Width = size;
            fill.Height = size;
            fill.RenderTransform = new TranslateTransform { X = -size / 2.0, Y = -size / 2.0 };
            fill.Fill = BrushConstants.Black;
            fill.SetValue(Canvas.ZIndexProperty, 10);
            Elements.Add(fill);
            WpfMouseCursor.RenderTarget.Children.Add(fill);
            Position = new Point(90, 90);
        }
    }
}
